package com.hlb.customeruserribbon.controller;


import com.hlb.customeruserribbon.pojo.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

/**
 * @author HanLiBin
 * @version V1.0
 */
@RestController
public class UserController {
    @Autowired
    private RestTemplate template;

    @GetMapping("/movice/{id}")
    public User findOneById(@PathVariable Integer id) {
        return template.getForObject("http://privode-user/simple/"+id,User.class);
    }
}
